/* store.js */
import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'

Vue.use(Vuex)

export default function createStore() {
      let store =  new Vuex.Store({
            state: {
                  homeInfo: '',
                  jumpUrl: {

                  }
            },
         
            mutations: {
                  jumpURL(state, name ) {
                       state.jumpUrl[name] && window.open( state.jumpUrl[name])
                  },
                  getURL (state) {
                       axios.get('/config.json').then((res) => {
                           state.jumpUrl = res.data
                              
                        })
                  }
            }
      })

      return store
}